package com.learn.spring.bean;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

/**
 * @author wangxing
 * @version 2020/6/12 13:59 Administrator
 */
public class Cat implements InitializingBean, DisposableBean {
    static {
        System.out.println("加载cat类");
    }

    {
        System.out.println("实例化Cat");
    }

    public Cat() {
        System.out.println("cat 构造");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("DisposableBean的destroy方法");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("InitializingBean的afterPropertiesSet方法");
    }
}
